﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class detail_news : System.Web.UI.Page
{
    dulieuDataContext db=new dulieuDataContext();
    protected void Page_Load(object sender, EventArgs e)
    {
        rpt_chi_tiet_tin.DataSource = from o in db.News
                                      where o.NewsID == Convert.ToDecimal(Request.QueryString["chi-tiet"])
                                      select o;
        rpt_chi_tiet_tin.DataBind();
        var cate =Convert.ToInt32((from o in db.News where o.NewsID == Convert.ToDecimal(Request.QueryString["chi-tiet"]) select o.Cate_ID).SingleOrDefault());
        rpttinkhac.DataSource = from o in db.News
                                where
                                    o.Cate_ID == cate && o.NewsID != Convert.ToDecimal(Request.QueryString["chi-tiet"])
                                select o;
        rpttinkhac.DataBind();
        lbltennhomtin.Text = (from o in db.Cates where o.Cate_ID == cate select o.Name).SingleOrDefault();


    }
}